package cn.tedu.straw.portal.controller;



import cn.tedu.straw.portal.service.IListuserService;
import cn.tedu.straw.portal.util.R;
import cn.tedu.straw.portal.vo.ClubVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/portal/club")
public class ClubController {

    @Autowired
    IListuserService userService;

    // http://localhost:9090/portal/club
    @GetMapping("")
    public R<List<ClubVO>> getClubList() {
        List<ClubVO> clubs = userService.getClubList();
        return R.ok(clubs);
    }

    @RequestMapping("/delete")
    public R delete(Integer id){
        userService.delete(id);
        return R.ok();


    }
}
